package seven_ThreadPool;

import java.util.concurrent.*;

public class Demo {
    public static void main(String[] args) {
        ExecutorService es = new ThreadPoolExecutor(3, 5, 1L, TimeUnit.SECONDS, new ArrayBlockingQueue<>(3), Executors.defaultThreadFactory(), new ThreadPoolExecutor.AbortPolicy());
        for (int i = 0; i < 9; i++) {
            es.execute(() -> {
                System.out.println(Thread.currentThread().getName() + "--->办理业务");
            });
        }
        es.shutdown();
    }
}
